// coms/more/more.js
Component({
  options: {
    addGlobalClass: true,
  },
  properties: {
    cateogries: Array,
  },

  data: {
    mainActiveIndex: 0,
    activeId: null,

    is_free: null,
    is_free_options: [
      { text: '全部', value: null },
      { text: '免费', value: 1 },
      { text: '非免费', value: 0 },
    ],
    sort: null,
    sort_options: [
      { text: '智能排序', value: 1 },
      { text: '好评排序', value: 2 },
      { text: '销量排序', value: 3 },
      { text: '距离排序', value: 4 },
    ],
    category_id: null,
    category_options: [],
  },

  onClickNav({ detail = {} }) {
    this.setData({
      mainActiveIndex: detail.index || 0,
    })
  },

  onClickItem({ detail = {} }) {
    const activeId = this.data.activeId === detail.id ? null : detail.id

    this.setData({ activeId })
  },
  /**
   * 组件的方法列表
   */
  methods: {},
})
